package com.wqz.controller;

import com.wqz.pojo.Commodity;
import com.wqz.service.CommodityService;
import com.wqz.service.impl.CommodityServiceImpl;
import com.wqz.utils.MessageJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;


@Controller
@RequestMapping("/index")
public class IndexController {

    //控制页面跳转
    @RequestMapping("/zhuce")
    public String zhuce(){
        //System.out.println("zhuce");
        return "zhuce";
    }

    @RequestMapping("/zhuye")
    public String zhuye(){
        //System.out.println("zhuye");
        return "zhuye";
    }
    @RequestMapping("/show")
    public String show() {
        return "show";
    }



    //@Resource
    //@Autowired
    //@Qualifier("commodityServiceImpl")
    //private CommodityService commodityService;
    //@ResponseBody
    //@RequestMapping("/test")
    //public MessageJson<List<Commodity>> test(@RequestParam("id") long id) {
    //    //System.out.println("测试测试");
    //    List<Commodity> commodityList = null;
    //    try {
    //        commodityList = commodityService.findCommodityList();
    //    } catch (Exception e) {
    //        e.printStackTrace();
    //    }

    //
    //    return new MessageJson<>("200","commodityMessage",commodityList);
    //}
}
